type Act = Int->Int;
type CNum = Act->Int->Int;

var zero = $var f:Act => $var x :Int => x;
var inc = $var x : Int => x + 1;
var succ = $var num:CNum => $var f:Act => $var x:Int => f(num(f)(x));
var one = succ(zero);
var two = succ(one);
var three = succ(two);
var add = $var m : CNum => $var n: CNum => $var f : Act => $var x:Int => m(f)(n(f)(x));

var five = add(three)(two);
var mul = $var m:CNum => $var n:CNum => $var f:Act => $var x:Int => m(n(f))(x);

var ten = mul(two)(five);

print(ten(inc)(0));

